﻿#region Using Statements

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

#endregion

namespace PrehistoricGame
{
    public class Background : IComparable
    {
        #region Fields

        float depth = 0f;
        Texture2D img;
        bool isWrapped = true;
        Vector2 offset = Vector2.Zero;
        #endregion

        #region Properties

        public float Depth 
        { 
            get { return depth; }
            set { depth = value;}
        }
        
        public Texture2D Img 
        {
            get { return img; }
            set { img = value;}
        }

        public bool IsWrapped 
        {
            get { return isWrapped; }
            set { isWrapped = value;}
        }

        public Vector2 Offset 
        {
            get { return offset; }
            set { offset = value;}
        }

        #endregion

        #region Constructors

        public Background(Texture2D img, float depth, bool isWrapped, Vector2 offset)
        {
            this.depth = depth;
            this.img = img;
            this.isWrapped = isWrapped;
            this.offset = offset;
        }

        public Background(Texture2D img, float depth)
            : this(img, depth, true, Vector2.Zero) { }

        #endregion

        public int CompareTo(object obj)
        {
            Background other = (Background)obj;
            if (this.depth > other.depth)
                return 1;
            else if (this.depth < other.depth)
                return -1;
            else
                return 0;
        }
    }
}
